package com.feng.Controller;

import com.feng.annotation.SystemLog;
import com.feng.domain.ResponseResult;
import com.feng.domain.entity.User;
import com.feng.domain.vo.UserInfoVo;
import com.feng.mapper.UserMapper;
import com.feng.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;
     @GetMapping("/userInfo")
     @SystemLog( businesName = "获取个人信息")
    public ResponseResult userInfo(){
       return userService.userInfo();
    }
    @PutMapping("/userInfo")
    @SystemLog( businesName = "更新用户信息")
    public ResponseResult updateUserInfo(@RequestBody User user){
         return userService.updateUserInfo(user);
    }
    @PostMapping("/register")
    public ResponseResult register(@RequestBody User user){
         return userService.register(user);

    }
    //修改密码接口
    @PostMapping("/updatePas")
    public ResponseResult updatePas(@RequestBody User user){
        return userService.updatePas(user);
    }
}
